package testes;

import java.awt.EventQueue;
import java.net.InetAddress;

import javax.swing.SwingUtilities;

import servidor.rede.Conexao;

import cliente.rede.ConexaoCliente;

import gui.telaCliente;
import gui.telaServidor;
import core.CoreGUI;
import core.RedeCore;
import core.RedeGUI;
import interfaces.InterfaceCoreGUI;
import interfaces.InterfaceRedeCore;
import interfaces.InterfaceRedeGUI;


public class TesteTelasClean {
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
		//EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
		//			InterfaceRedeCore interfaceRedeCore = new RedeCore();
			//		InterfaceRedeGUI interfaceRedeGUI = new RedeGUI();
				//	InterfaceCoreGUI interfaceCoreGUI = new CoreGUI();
					
					//inicializa tela servidor
					new telaServidor();
					telaServidor.frmServidor.setVisible(true);
					Conexao conexaoservidor = new Conexao(5001); 
					
					//Thread.sleep(2000);
					
					//inicializa tela cliente
					new telaCliente();
					telaCliente.frmCliente.setVisible(true);
					InetAddress ip = InetAddress.getByName("localhost");
					ConexaoCliente conexaocliente = new ConexaoCliente(ip, 5002);
					
					
					//new InterfaceRedeCore().geraListaDeArquivos("./");
					//interfaceRedeCore.geraListaDeArquivos("./");					
						
					//new RedeGUI().novoUsuarioConectado("192.168.7.30", 5001);
					//new RedeGUI().novoUsuarioConectado("192.168.7.31", 5001);
					//new RedeGUI().novoUsuarioConectado("192.168.7.32", 5001);

					//ADD NOVO USUARIO CONECTADO
//					interfaceRedeGUI.novoUsuarioConectado("192.168.7.30", 5001);
//					interfaceRedeGUI.novoUsuarioConectado("192.168.7.31", 5001);
//					interfaceRedeGUI.novoUsuarioConectado("192.168.7.32", 5001);
//				
//					
					//new CoreGUI().novoArquivoServidor("Metallica - The Unforgiven");
					//new CoreGUI().novoArquivoServidor("Metallica - Fade To Black");

					//ADD NOVO ARQUIVO NO SERVIDOR
					//interfaceCoreGUI.novoArquivoServidor("Metallica - The Unforgiven");
					//interfaceCoreGUI.novoArquivoServidor("Metallica - Fade To Black");

					//new RedeGUI().novaTransferencia("Metallica - The Unforgiven", "192.168.7.30", 5001);
					//new RedeGUI().novaTransferencia("Metallica - Fade To Black", "192.168.7.31", 5001);
					//new RedeGUI().novaTransferencia("Metallica - Fade To Black", "192.168.7.32", 5001);
					//new RedeGUI().novaTransferencia("Metallica - Fade To Black", "192.168.7.33", 5001);
					//new RedeGUI().novaTransferencia("Metallica - The Unforgiven", "192.168.7.33", 5001);

					//ADD NOVA TRANFERENCIA
//					interfaceRedeGUI.novaTransferencia("Metallica - The Unforgiven", "192.168.7.30", 5001);
//					interfaceRedeGUI.novaTransferencia("Metallica - Fade To Black", "192.168.7.31", 5001);
//					interfaceRedeGUI.novaTransferencia("Metallica - Fade To Black", "192.168.7.32", 5001);
//					interfaceRedeGUI.novaTransferencia("Metallica - Fade To Black", "192.168.7.33", 5001);
//					
					//new RedeGUI().setTransferencia("Metallica - Fade To Black", "192.168.7.32", "88%");
					//new RedeGUI().setTransferencia("Metallica - The Unforgiven", "192.168.7.33", 100);

					//SET PROGRESSO TRANSFERENCIA
					//interfaceRedeGUI.setTransferencia("Metallica - Fade To Black", "192.168.7.32", "100%");
					//interfaceRedeGUI.setTransferencia("Metallica - The Unforgiven", "192.168.7.30", "100%");
					
					/*
					 */					
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	}